package cn.git.shiro.token;

import lombok.Data;
import org.apache.shiro.authc.AuthenticationToken;

/**
 * @description: jwtToken
 * @program: bank-credit-sy
 * @author: lixuchun
 * @create: 2024-03-27
 */
@Data
public class JwtToken implements AuthenticationToken {

    private static final long serialVersionUID = 7586393396529236574L;

    /**
     * token
     */
    private String token;

    /**
     * 构造方法
     * @param token
     */
    public JwtToken(String token) {
        this.token = token;
    }

    /**
     * 获取用户信息 username，从token获取
     * @return
     */
    @Override
    public Object getPrincipal() {
        return token;
    }

    /**
     * 获取凭证信息 password，从token获取
     * @return
     */
    @Override
    public Object getCredentials() {
        return token;
    }
}
